package com.Bigbluebook.Service;

import com.Bigbluebook.entity.Like;
import com.Bigbluebook.entity.LikeStatus;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface LikeService {
    @POST("likes")
    Call<Like> likePost(@Body Like like);

    @POST("comments/likes")
    Call<Like> likeComment(@Body Like like);

    @GET("posts/{postId}/likes")
    Call<List<Like>> getLikesForPost(@Path("postId") int postId);

    @DELETE("likes/{id}")
    Call<Void> unlikePost(@Path("id") int likeId);

    @DELETE("comments/likes/id")
    Call<Void> unlikeComment(@Path("id") int likeId);

    @GET("likes/posts/{postId}/user/{userId}/hasLiked")
    Call<LikeStatus> checkLikeStatus(@Path("postId") int postId, @Path("userId") int userId);
}
